package org.hxd.dept.dao;

import org.apache.ibatis.annotations.*;
import org.hxd.pojo.Dept;
import org.hxd.units.PageModel;

import java.util.List;

public interface DeptDao {
    @SelectProvider(type = DeptDaoSql.class,method = "findDept")
    List<Dept> findDept(@Param("pageModel") PageModel pageModel, @Param("name") String name);

    @SelectProvider(type = DeptDaoSql.class,method = "findDeptCount")
    int findDeptCount(@Param("dept") Dept dept);

    @Select("select id,name,remark from dept_inf where id = #{id}")
    Dept findDeptByid(Integer id);

    @Update("update dept_inf set name=#{name},remark=#{remark} where id = #{id}")
    int modifyDept(Dept dept);

    @Insert("insert into dept_inf (name,remark) values(#{name},#{remark})")
    int addDept(Dept dept);

    @DeleteProvider(type = DeptDaoSql.class,method = "removeDept")
    int removeDept(@Param("ids") Integer[] ids);
}
